#include <iostream>

class demo_inherit {
 public:
  /* data */
  int sum;

 private:
  int subsum;

 public:
  demo_inherit(/* args */);
  ~demo_inherit();
};

demo_inherit::demo_inherit(/* args */) {
  this->sum = 100;
  this->subsum = 1000;
}

demo_inherit::~demo_inherit() {}

class sub : private demo_inherit {
 public:
  sub() {}
  ~sub() {}
  int getSum() {
    std::cout << "sum" << sum << std::endl;  //可访问
    // std::cout << "sum" << subsum << std::endl;//不可访问
  }
};

int main(int argc, char const *argv[]) {
  sub s;
  s.getSum();
  return 0;
}